package behavioralPatterns.template;

abstract class AbstractClass {
    public void templateMethod() {
        preProcess();
        process();
        postProcess();
    }

    protected void preProcess() {
        System.out.println("Pre-processing");
    }

    protected abstract void process();

    protected void postProcess() {
        System.out.println("Post-processing");
    }
}

class ConcreteClass extends AbstractClass {
    protected void process() {
        System.out.println("Processing");
    }
}

public class TemplatePattern {
    public static void main(String[] args) {
        AbstractClass abstractClass = new ConcreteClass();
        abstractClass.templateMethod();
    }
}
